<h3 style="padding-bottom: 5px">Please select the group to move</h3>
<% if @groups.empty? %>
    <p>You don't have any groups defined. Why not create one ?</p>
<% end%>
<% form_tag({:action=>'move'}, {:id=>'move_group_form'}) do%>
<div id="images_container" style="width:580px;padding:0 10px;">
    <% puts params.inspect
       @groups.each do |group|
       image = group.images.first
    %>
      <div class="image_cell">
            <div class="image_box"><a id="group_link_<%= group.id%>" onclick="move_submit(<%= group.id%>); return false;" href="/groups/move/<%= group.id%>"><img src="/pictures/<%= image!=nil ? image.small_file : 'blank.jpg'%>" /></a></div>
            <%= group.name%>
      </div>

    <% end %>
    <div class="clear" width="0px"></div>
    <div style="width:50px;">
    <%= pagination_links_remote(@group_pages, :window_size => 5, :update => "modal_dialog_message", :with_form => 'move_group_form')%>
    </div>
</div>
<%= hidden_field_tag 'group_id', nil %>
<%= hidden_field_tag 'selected_ids', params[:selected_ids] %>
<%= hidden_field_tag 'old_group_id', params[:id] %>
<% end %>
<script>
function move_submit(group_id) {
    $('group_id').value = group_id    
    $('move_group_form').submit();
}
</script>

